package com.heima.behavior.controller.v1;

import com.heima.api.behavior.ApUnLikesBehaviorControllerApi;
import com.heima.behavior.service.ApUnlikesBehaviorService;
import com.heima.model.behavior.dtos.UnLikesBehaviorDto;
import com.heima.model.common.dtos.ResponseResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @ClassName ApUnLikesBehaviorController
 * @Description TODO
 * @Author AWei
 * @DATE 2021/4/22 23:44
 * @Version 1.0
 */
@RestController
@RequestMapping("/api/v1/unlike_behavior")
public class ApUnLikesBehaviorController implements ApUnLikesBehaviorControllerApi {

    @Resource
    private ApUnlikesBehaviorService apUnlikesBehaviorService;

    /**
     * @param dto 不喜欢行为对象
     * @return 保存结果
     * @Description 保存不喜欢行为
     */
    @Override
    @PostMapping
    public ResponseResult unLike(@RequestBody @Validated UnLikesBehaviorDto dto) {
        return apUnlikesBehaviorService.unLike(dto);
    }
}
